package cn.amebius.simpledocker.entity.po;

import cn.amebius.simpledocker.exception.DataErrorException;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * tb_user_role_relation的Po
 * @author 阿伟
 * @date 2023/7/28 16:16
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserRoleRelationPo extends BasePo{

    private Integer userId;

    private Integer roleId;

    public static void check(UserRoleRelationPo urrp) {
        if (urrp == null || urrp.userId.toString().isEmpty() || urrp.roleId.toString().isEmpty()) {
            throw  new DataErrorException("数据异常: 用户角色关系丢失");
        }
        BasePo.check(urrp);
    }

}
